import {TForm} from "../../hcl/Forms.js";
import {application} from "../../hcl/Application.js";
import {TColor} from "../../hcl/Graphics.js";
import {EmrTabControl} from "./EmrTabControl.js";
import {THCView} from "../HCView.js";

export class EmrForm extends TForm {


    constructor(width, height) {

        super(width, height);
        //不可见
        this.lblCaption.visible = false;

        //关闭按钮
        this.btnClose.visible = false;

        //设置图标
        this.setIcon_();

        //设置第一行工具属性
        this.setCaptionBarProperties_();


    }

    setIcon_() {
        //增加图标
        this.captionBar.addButton("", false, application.icon.src).onClick = function () {
            //reload
        }
    }

    setCaptionBarProperties_() {

        //设置为不透明
        this.captionBar.transparent = false;

        //设置背景颜色
        this.captionBar.color = TColor.rgbaToColor(2, 119, 189);

        //设置高度
        this.captionBar.height = 120;

        //tab
        let pageControl = new EmrTabControl({});

        //设置tab
        this.captionBar.addControl(pageControl);

    }



    addControl(control) {
        if(control.isClass(THCView)){
            this.hcView =control;
        }
        super.addControl(control);
    }

}